<?php 
include '../header.php';




$pages=sql_query ("select * FROM `page` WHERE address='$a'");
if (mysql_num_rows($pages)>=1) 
{
	echo $page['access'];
	if ($page['access']==100 && $admin!='admin') {echo 'Нет доступа';}
	elseif ($page['access']==2 && $auth!=1) {echo 'Нет доступа';}
	else {
	$page=mysql_fetch_array($pages);
	if ($page['type']=='link') {include '../service/'.$page['address'].'.php';} else
	{echo $page['text']; } 
		}}
 else { //header('Location: /error/404'); 
 }	
if ($auth==1) {}

elseif ($admin=='admin') {}


include '../footer.php';
/*$id_author=$page['id_author'];
	$userz=sql_query ("SELECT * FROM `user` WHERE id='$id_author'");
	$user = mysql_fetch_array($userz);
	$category=$page['category'];
	$categz=sql_query ("SELECT * FROM `category` WHERE id='$category'");
	$categ = mysql_fetch_array($categz);
	    
    
	echo '<br />
<br />
<table width="100%" border="1">
  <tr>
    <td><a href="/profile.php?id='.$id_author.'">'.$user['login'].'</a></td>
    <td>'.parse_date($page['date']).'</td>
  </tr>
</table>
';*/
?>